#!/bin/bash

cd $(dirname $(readlink -f $0))

SRC_ROOT=$WS_ROOT/moveit2

cp colcon.meta ..
cp colcon_defaults.yaml ..
cp ohos.toolchain.docker.cmake ..

echo "NOTE: This built will skip moveit_ros_perception (Use OpenGL & GLEW for GUI) and wiimote/wiimote_msgs/spacenav (Use bluetooth library)."
read -p "Source Root: ${SRC_ROOT}; Dependency Root: ${SRC_ROOT}/moveit_deps; Press any key (except Ctrl+C) to continue... "

cd $SRC_ROOT

colcon build --metas $SRC_ROOT/colcon.meta --merge-install --event-handlers console_cohesion+ --cmake-args -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_VERBOSE_MAKEFILE=ON -Wno-dev -DCMAKE_TOOLCHAIN_FILE=$SRC_ROOT/ohos.toolchain.docker.cmake

